//
//  NewsThreeCell.swift
//  SinaNews
//
//  Created by hroot on 15/8/14.
//  Copyright (c) 2015年 Lily. All rights reserved.
//

import UIKit

class NewsThreeCell: UITableViewCell {

    
    @IBOutlet weak var titleLabel: UILabel!

    @IBOutlet weak var firstImage: UIImageView!
    @IBOutlet weak var secondImage: UIImageView!
    @IBOutlet weak var thirdImage: UIImageView!
    @IBOutlet weak var commentImage: UIImageView!
    @IBOutlet weak var commentLabel: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        self.selectionStyle = UITableViewCellSelectionStyle.None
    }
    
    func showData(model: NewsModel) -> Void {
        self.titleLabel.text = model.title
        var imageDict: NSDictionary = model.pics!
        var imageArr: NSArray = imageDict["list"] as! NSArray
        self.firstImage.sd_setImageWithURL(NSURL(string: (imageArr[0] as! NSDictionary).valueForKey("kpic")as! String), placeholderImage: UIImage(named: "icon"))
        self.secondImage.sd_setImageWithURL(NSURL(string: (imageArr[1] as! NSDictionary).valueForKey("kpic")as! String), placeholderImage: UIImage(named: "icon"))
        self.thirdImage.sd_setImageWithURL(NSURL(string: (imageArr[2] as! NSDictionary).valueForKey("kpic")as! String), placeholderImage: UIImage(named: "icon"))
        var commentDict = model.comment_count_info
        self.commentLabel.text = commentDict!.valueForKey("total")!.stringValue
        self.commentImage.image = UIImage(named: "feed_cell_commentIcon")
    }
    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    
    
    
    
    
    
    
}
